{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Image"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import com.twosigma.beakerx.widget.Image\n",
    "import java.nio.file.Files\n",
    "\n",
    "byte[] picture = Files.readAllBytes(new File(\"../../../doc/resources/img/widgetArch.png\").toPath());\n",
    "\n",
    "image = new Image()\n",
    "image.format='png'\n",
    "image.value= picture\n",
    "image.width=300\n",
    "image.height=400\n",
    "image"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# DatePicker"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import com.twosigma.beakerx.widget.DatePicker\n",
    "datePicker = new DatePicker()\n",
    "datePicker"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "datePicker.value"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "datePicker.value = '20181027'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "datePicker.description = 'happy day'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "datePicker.disabled = true"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# ColorPicker"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import com.twosigma.beakerx.widget.ColorPicker\n",
    "cp = new ColorPicker()\n",
    "cp.value = \"blue\"\n",
    "cp"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "cp.value"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "cp.value = 'red'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "cp.concise = true"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "cp.concise = false\n",
    "cp.description = 'happy color'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "cp.disabled = true"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Box"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import com.twosigma.beakerx.widget.IntSlider\n",
    "import com.twosigma.beakerx.widget.IntProgress\n",
    "import com.twosigma.beakerx.widget.VBox\n",
    "\n",
    "is = new IntSlider(value:30)\n",
    "ip = new IntProgress(value: 30)\n",
    "v = new VBox([is, ip])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import com.twosigma.beakerx.widget.IntSlider\n",
    "import com.twosigma.beakerx.widget.IntProgress\n",
    "import com.twosigma.beakerx.widget.HBox\n",
    "\n",
    "is2 = new IntSlider(value:30)\n",
    "ip2 = new IntProgress(value: 30)\n",
    "h = new HBox([is2, ip2])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Tabs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import com.twosigma.beakerx.widget.IntSlider\n",
    "import com.twosigma.beakerx.widget.IntProgress\n",
    "import com.twosigma.beakerx.widget.Tab\n",
    "\n",
    "is3 = new IntSlider(value:30)\n",
    "ip3 = new IntProgress(value: 30)\n",
    "tb = new Tab([is3, ip3], ['speed', 'time'])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Accordion"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import com.twosigma.beakerx.widget.IntSlider\n",
    "import com.twosigma.beakerx.widget.IntProgress\n",
    "import com.twosigma.beakerx.widget.Accordion\n",
    "\n",
    "is4 = new IntSlider(value:30)\n",
    "ip4 = new IntProgress(value: 30)\n",
    "ac = new Accordion([is4, ip4], ['speed', 'time'])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Play"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import com.twosigma.beakerx.widget.Play\n",
    "import com.twosigma.beakerx.widget.IntSlider\n",
    "import com.twosigma.beakerx.widget.HBox\n",
    "import com.twosigma.beakerx.widget.Link\n",
    "\n",
    "slider1 = new IntSlider()\n",
    "play1 = new Play(value : 10, min : 0, max : 100)\n",
    "link1 = new Link(play1, \"value\", slider1, \"value\")\n",
    "box1 = new HBox([play1, slider1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import com.twosigma.beakerx.widget.Play\n",
    "import com.twosigma.beakerx.widget.IntSlider\n",
    "import com.twosigma.beakerx.widget.HBox\n",
    "import static com.twosigma.beakerx.widget.Link.jslink\n",
    "\n",
    "slider2 = new IntSlider()\n",
    "play2 = new Play(value : 20, min : 0, max : 100)\n",
    "link2 = jslink(play2, \"value\", slider2, \"value\")\n",
    "box2 = new HBox([play2, slider2])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import com.twosigma.beakerx.widget.Play\n",
    "import com.twosigma.beakerx.widget.IntSlider\n",
    "import com.twosigma.beakerx.widget.HBox\n",
    "import com.twosigma.beakerx.widget.DirectionalLink\n",
    "\n",
    "slider3 = new IntSlider()\n",
    "play3 = new Play(value : 30, min : 0, max : 100)\n",
    "link3 = new DirectionalLink(play3, \"value\", slider3, \"value\")\n",
    "box3 = new HBox([play3 ,slider3])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import com.twosigma.beakerx.widget.Play\n",
    "import com.twosigma.beakerx.widget.IntSlider\n",
    "import com.twosigma.beakerx.widget.HBox\n",
    "import static com.twosigma.beakerx.widget.DirectionalLink.jsdlink\n",
    "\n",
    "slider4 = new IntSlider()\n",
    "play4 = new Play(value : 40, min : 0, max : 100)\n",
    "link4 = jsdlink(play4, \"value\", slider4, \"value\")\n",
    "box4 = new HBox([play4, slider4])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Groovy",
   "language": "groovy",
   "name": "groovy"
  },
  "language_info": {
   "codemirror_mode": "groovy",
   "file_extension": ".groovy",
   "mimetype": "",
   "name": "Groovy",
   "nbconverter_exporter": "",
   "version": "2.4.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": false,
   "sideBar": false,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": false,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
